import request from '@/utils/request'

// 报表列表
export function report_list(data) {
  return request({
    url: '/system/report/list',
    method: 'get',
    params: data
  })
}

// 报表新增
export function report_add(data) {
  return request({
    url: '/system/report/add',
    method: 'post',
    data: data
  })
}

// 报表删除
export function report_remove(data) {
  return request({
    url: '/system/report/remove',
    method: 'post',
    data: data
  })
}

// 报表分类关系删除
export function report_type_drop(data) {
  return request({
    url: '/system/report/drop',
    method: 'post',
    data: data
  })
}

// 报表详情
// export function report_get(data) {
//   return request({
//     url: '/system/report/getComponent',
//     method: 'post',
//     data: data
//   })
// }

// 报表详情new
export function report_get(data) {
  return request({
    url: '/system/report/getReport',
    method: 'post',
    data: data
  })
}

// 报表编辑
export function report_getById(data) {
  return request({
    url: '/system/report/get',
    method: 'post',
    data: data
  })
}

// 报表详情
export function report_edit(data) {
  return request({
    url: '/system/report/edit',
    method: 'post',
    data: data
  })
}

// 报表导出
export function report_export(data) {
  return request({
    url: '/system/report/export',
    method: 'post',
    data: data
  })
}

// 获取所有未关联分类的报表列表
export function report_queryList(data) {
  return request({
    url: '/system/report/queryList',
    method: 'post',
    data: data
  })
}

// 获取组件真实数据
export function report_getComponent(data) {
  return request({
    url: '/system/report/getComponent',
    method: 'post',
    data: data
  })
}

// 获取报表真实数据
export function report_getReport(data) {
  return request({
    url: '/system/report/getReport',
    method: 'post',
    data: data
  })
}

// 刷新频率
export function report_getFrequencyList(data) {
  return request({
    url: '/system/report/getFrequencyList',
    method: 'post',
    data: data
  })
}

// 获取时间区间
export function report_getTimeintervalList(data) {
  return request({
    url: '/system/report/getTimeintervalList',
    method: 'post',
    data: data
  })
}

// 报表组件树
export function report_tree(data) {
  return request({
    url: '/system/report/subject/tree',
    method: 'post',
    data: data
  })
}

// 报表分类删除
export function report_subject_remove(data) {
  return request({
    url: '/system/report/subject/remove',
    method: 'post',
    data: data
  })
}

// 报表分类编辑
export function report_subject_edit(data) {
  return request({
    url: '/system/report/subject/edit',
    method: 'post',
    data: data
  })
}

// 报表分类新增
export function report_subject_add(data) {
  return request({
    url: '/system/report/subject/add',
    method: 'post',
    data: data
  })
}

// 拖拽报表到分类树上时调用，传入报表id 和 typeId
export function report_dragReport(data) {
  return request({
    url: '/system/report/subject/dragReport',
    method: 'post',
    data: data
  })
}
